package com.wzh.yebServe.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author wzh
 * @create 2022/11/6 11:10
 * @Description: 返回公共对象
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultBean {
    /**
     * 返回响应码，代表响应状态
     */
    private Integer code;
    /**
     * 返回所携带的信息
     */
    private String msg;
    /**
     *
     */
    private Object obj;


    public static ResultBean success(String message){
        return new ResultBean(200,message,null);
    }

    public static ResultBean success(String message,Object obj){
        return new ResultBean(200,message,obj);
    }

    /**
     * 内部服务器错误返回给前端
     * @param message
     */

    public static ResultBean error(String message){
        return new ResultBean(500,message,null);
    }

    public static ResultBean error(String message,Object obj){
        return new ResultBean(500,message,obj);
    }

}
